<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MappingControl.ascx.cs" Inherits="Awaken.CodeGen.Controls.MappingControl" %><?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
    <class name="<%= Namespace %>.<%= Table.ClassName %>, <%= Assembly %>" table="<%= Table.TableName %>">
        <meta attribute="Database"><%= DatabaseName %></meta>
        
        <asp:Repeater ID="idRepeater" runat="server">
        <ItemTemplate>
        <id name="<%# Eval("PropertyName") %>" type="<%# Eval("NHibernateTypeName") %>">
            <column name="<%# Eval("ColumnName") %>"></column>
            <generator class="<%# Eval("GeneratorClass") %>"></generator>
        </id>
        </ItemTemplate>
        </asp:Repeater>
        
        <asp:Repeater ID="fieldRepeater" runat="server">
        <ItemTemplate>
        <property name="<%# Eval("PropertyName") %>" type="<%# Eval("NHibernateTypeName") %>">
            <meta attribute="DataType"><%# Eval("DataType") %></meta>
            <column name="<%# Eval("ColumnName") %>"></column>
        </property>
        </ItemTemplate>
        </asp:Repeater>
        
        <asp:Repeater ID="oneToManyRepeater" runat="server">
        <ItemTemplate>
        <bag name="<%# Eval("OtherTableCollectionName") %>" table="<%# Eval("OtherTableName") %>" inverse="true" lazy="true">
            <key>
                <column name="<%# Eval("CurrentTableColumnName") %>" /> 
            </key>
            <one-to-many class="<%= Namespace %>.<%# Eval("OtherTableClassName") %>, <%= Assembly %>" /> 
        </bag>
        </ItemTemplate>
        </asp:Repeater>
        
        <asp:Repeater ID="manyToOneRepeater" runat="server">
        <ItemTemplate>
        <many-to-one name="<%# Eval("OtherTableClassName") %>" class="<%= Namespace %>.<%# Eval("OtherTableClassName") %>, <%= Assembly %>" column="<%# Eval("CurrentTableColumnName") %>" insert="false" update="false" not-null="false" />
        </ItemTemplate>
        </asp:Repeater>
        
        <asp:Repeater ID="manyToManyRepeater" runat="server">
        <ItemTemplate>
        <bag name="<%# Eval("OtherTableCollectionName") %>" table="<%# Eval("ManyToManyTableName") %>" inverse="true" lazy="true">
            <key>
                <column name="<%# Eval("CurrentTableIdColumnName") %>" /> 
            </key>
            <many-to-many class="<%= Namespace %>.<%# Eval("OtherTableClassName") %>, <%= Assembly %>" column="<%# Eval("OtherTableIdColumnName") %>" /> 
        </bag>
        </ItemTemplate>
        </asp:Repeater>
    </class>	
</hibernate-mapping>